home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / source / uSMSDetail.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2004-06-14  |  3.8 KB  |  169 lines

  1. unit uSMSDetail;
  2.  
  3. {
  4. *******************************************************************************
  5. * Descriptions: SMS Detail view implementation
  6. * $Source: /cvsroot/fma/fma/uSMSDetail.pas,v $
  7. * $Locker:  $
  8. *
  9. * Todo:
  10. *   - More information to show
  11. *
  12. * Change Log:
  13. * $Log: uSMSDetail.pas,v $
  14. * Revision 1.8  2004/06/14 09:33:05  z_stoichev
  15. * Fixed label unicode support.
  16. *
  17. * Revision 1.7  2004/05/19 18:34:16  z_stoichev
  18. * Build 0.1.0.35c
  19. *
  20. * Revision 1.6  2003/11/28 09:38:07  z_stoichev
  21. * Merged with branch-release-1-1 (Fma 0.10.28c)
  22. *
  23. * Revision 1.5.2.5  2003/11/13 16:37:10  z_stoichev
  24. * Changed images.
  25. *
  26. * Revision 1.5.2.4  2003/11/06 16:08:49  z_stoichev
  27. * Close work now.
  28. *
  29. * Revision 1.5.2.3  2003/11/04 11:41:20  z_stoichev
  30. * Made Close button work with ESC hit.
  31. *
  32. * Revision 1.5.2.2  2003/10/31 14:38:51  z_stoichev
  33. * Added Close button, instead of OK, Cancel.
  34. *
  35. * Revision 1.5.2.1  2003/10/27 07:22:54  z_stoichev
  36. * Build 0.1.0 RC1 Initial Checkin.
  37. *
  38. * Revision 1.5  2003/10/23 12:28:36  z_stoichev
  39. * Fixed Win XP theme tabsheet issue.
  40. * Added more information fields.
  41. * Font changed.
  42. *
  43. * Revision 1.4  2003/10/17 09:14:10  z_stoichev
  44. * Changed GUI.
  45. *
  46. * Revision 1.3  2003/01/30 04:15:57  warren00
  47. * Updated with header comments
  48. *
  49. *
  50. *******************************************************************************
  51. }
  52.  
  53. interface
  54.  
  55. uses
  56.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  57.   Dialogs, ExtCtrls, StdCtrls, ComCtrls, TntStdCtrls;
  58.  
  59. type
  60.   TfrmDetail = class(TForm)
  61.     PageControl1: TPageControl;
  62.     TabSheet1: TTabSheet;
  63.     Label2: TLabel;
  64.     edFrom: TEdit;
  65.     Label1: TLabel;
  66.     edSMSC: TEdit;
  67.     Label3: TLabel;
  68.     edTimeStamp: TEdit;
  69.     Button1: TButton;
  70.     Label4: TLabel;
  71.     memoText: TTntMemo;
  72.     Label6: TLabel;
  73.     edUDHI: TEdit;
  74.     ebRef: TEdit;
  75.     Label7: TLabel;
  76.     memoPDU: TMemo;
  77.     Label5: TLabel;
  78.     Bevel1: TBevel;
  79.     Image1: TImage;
  80.     Bevel2: TBevel;
  81.     lblName: TTntLabel;
  82.     procedure Button1Click(Sender: TObject);
  83.     procedure FormCreate(Sender: TObject);
  84.     procedure FormShow(Sender: TObject);
  85.   private
  86.     FPDU: String;
  87.     procedure SetPDU(const Value: String);
  88.     { Private declarations }
  89.   public
  90.     { Public declarations }
  91.     property PDU: String read FPDU write SetPDU;
  92.   end;
  93.  
  94. var
  95.   frmDetail: TfrmDetail;
  96.  
  97. implementation
  98.  
  99. uses gsm_sms, Unit1;
  100.  
  101. {$R *.dfm}
  102.  
  103. { TfrmDetail }
  104.  
  105. procedure TfrmDetail.SetPDU(const Value: String);
  106. var
  107.   sms: Tsms;
  108. begin
  109.   FPDU := Value;
  110.  
  111.   sms := Tsms.Create;
  112.   try
  113.     sms.PDU := FPDU;
  114.  
  115.     edFrom.Text := sms.Number;
  116.  
  117.     memoText.Text := sms.Text;
  118.     edUDHI.Text := sms.UDHI;
  119.     if edUDHI.Text = '' then edUDHI.Text := '(No Information)';
  120.     ebRef.Text := sms.MessageReference;
  121.  
  122.     edSMSC.Text := sms.SMSC;
  123.     if edSMSC.Text = '' then edSMSC.Text := '(No Information)';
  124.  
  125.     if sms.TimeStamp > 0 then
  126.       edTimeStamp.Text := DateTimeToStr(sms.TimeStamp)
  127.     else
  128.       edTimeStamp.Text := '(No Information)';
  129.  
  130.     memoPDU.Clear;
  131.  
  132.     if sms.IsOutgoing then begin
  133.       Label2.Caption := 'To Address:';
  134.       memoPDU.Lines.Add('Message Type: SMS SUBMIT');
  135.     end
  136.     else begin
  137.       Label2.Caption := 'From Address:';
  138.       memoPDU.Lines.Add('Message Type: SMS DELIVER');
  139.     end;
  140.  
  141.     memoPDU.Lines.Add('');
  142.     memoPDU.Lines.Add(FPDU);
  143.  
  144.     lblName.Caption := Form1.LookupContact(sms.Number);
  145.   finally
  146.     sms.Destroy;
  147.   end;  
  148. end;
  149.  
  150. procedure TfrmDetail.Button1Click(Sender: TObject);
  151. begin
  152.   Close;
  153. end;
  154.  
  155. procedure TfrmDetail.FormCreate(Sender: TObject);
  156. begin
  157. {$IFNDEF VER150}
  158.   Form1.ThemeManager1.CollectForms(Self);
  159. {$ENDIF}
  160. end;
  161.  
  162. procedure TfrmDetail.FormShow(Sender: TObject);
  163. begin
  164.   PageControl1.ActivePageIndex := 0;
  165.   Button1.SetFocus;
  166. end;
  167.  
  168. end.
  169.